<template>
	<view>
		<view class="webkit" style="padding: 20upx 28upx;">
			<image src="../../../static/stardown.png" mode="" style="width: 34upx;height: 34upx;margin-top: 6upx;margin-right: 10upx;"></image>
			<view class="flex" style="color: #888;">代表已成为代言人的下级</view>
		</view>
		<view>
			<view style="padding:30upx 20upx;background: #fff;" v-for="(item,index) in res" :key="index" class="webkit">
				<image :src="item.avatar" mode="" style="width: 80upx;height: 80upx;border-radius: 50%;margin-right: 20upx;"></image>
				<view class="flex">
					<view class="webkit">
						<image src="../../../static/stardown.png" mode="" style="width: 30upx;height: 30upx;margin-top: 4upx;margin-right: 10upx;"></image>
						<view style="font-size: 28upx;color: #000;line-height: 42upx;" v-cloak>{{item.nickname}}</view>
					</view>
					<view style="font-size: 24upx;color: #999;line-height: 36upx;" v-cloak>成为代言人时间： v-cloakitem.createtime}}</view>
				</view>
				<view class="mid">
					<text v-cloak>{{item.agentcount}}个成员</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				res:[],
				openid:''
			};
		},
		onLoad:function(){
			uni.showLoading()
			uni.getStorage({
				key: 'openid',
				success: (res) => {
					this.openid = res.data
					this.setAjax()
				},
				fail: () => {
					uni.navigateTo({
						url: '../../login/login'
					});
				}
			});
		},
		methods:{
			setAjax(){
				uni.request({
					url: 'http://hszj.hongshantang696.com//app/index.php?i=4&c=entry&m=ewei_shopv2&do=mobile&r=commission.down.get_list&app=1&page=1',
					method: 'POST',
					data: {'openid':this.openid},
					header:{'Content-Type':'application/x-www-form-urlencoded'},
					success: res => {
						uni.hideLoading()
						this.res = res.data.result.list
					},
					fail: () => {},
					complete: () => {}
				});
			}
		}
	}
</script>

<style>.mid text{font-size:24upx;margin-left:20upx;}</style>